public abstract class Duck {
    private FlyBehavior ifly;
    public Duck() {
        // default
        ifly = new FlyWithWings();
    }
    public Duck(FlyBehavior ifly) {
        this.ifly = ifly;
    }
    void setFlyBehavior(FlyBehavior fb) { ifly = fb; }
    void fly() {
        ifly.fly();
    }
}
